package com.ponhu.ea2.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 系列表
 *
 * @TableName ph_series
 */
@TableName(value = "ph_series")
@Data
public class PhSeries implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 系列code 自动生成,继承父类层级，比如：父类层级为1001,子类code为1001001，当查询的时候想快速查询可通过级联code来实现，默认从1001开始，同级类别在个位数递增+1即可
     */
    private String seriesCode;

    /**
     * 系列名称
     */
    private String name;

    /**
     * 父级系列ID
     */
    private Long parentId;

    /**
     * 系列等级 如果是第一层级默认为1
     */
    private Integer level;

    /**
     * 品牌ID
     */
    private Long brandId;

    /**
     * 参考图链接
     */
    private String imageUrl;

    /**
     * 尺寸(英寸)
     */
    private String sizeInch;

    /**
     * 尺寸(厘米)
     */
    private String sizeCm;

    /**
     * 创建人ID
     */
    private Long createdById;

    /**
     * 创建人名称
     */
    private String createdByName;

    /**
     * 创建时间
     */
    private Date createdTime;

    /**
     * 更新人ID
     */
    private Long updateById;

    /**
     * 更新人名称
     */
    private String updateByName;

    /**
     * 中文别名
     */
    private String anotherName;

    /**
     * 更新时间
     */
    private Date updatedTime;

    /**
     * 数据类型，1.标准数据，2非标准数据
     */
    private Integer dataType;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PhSeries other = (PhSeries) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getSeriesCode() == null ? other.getSeriesCode() == null : this.getSeriesCode().equals(other.getSeriesCode()))
                && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
                && (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId()))
                && (this.getLevel() == null ? other.getLevel() == null : this.getLevel().equals(other.getLevel()))
                && (this.getBrandId() == null ? other.getBrandId() == null : this.getBrandId().equals(other.getBrandId()))
                && (this.getImageUrl() == null ? other.getImageUrl() == null : this.getImageUrl().equals(other.getImageUrl()))
                && (this.getSizeInch() == null ? other.getSizeInch() == null : this.getSizeInch().equals(other.getSizeInch()))
                && (this.getSizeCm() == null ? other.getSizeCm() == null : this.getSizeCm().equals(other.getSizeCm()))
                && (this.getCreatedById() == null ? other.getCreatedById() == null : this.getCreatedById().equals(other.getCreatedById()))
                && (this.getCreatedByName() == null ? other.getCreatedByName() == null : this.getCreatedByName().equals(other.getCreatedByName()))
                && (this.getCreatedTime() == null ? other.getCreatedTime() == null : this.getCreatedTime().equals(other.getCreatedTime()))
                && (this.getUpdateById() == null ? other.getUpdateById() == null : this.getUpdateById().equals(other.getUpdateById()))
                && (this.getUpdateByName() == null ? other.getUpdateByName() == null : this.getUpdateByName().equals(other.getUpdateByName()))
                && (this.getUpdatedTime() == null ? other.getUpdatedTime() == null : this.getUpdatedTime().equals(other.getUpdatedTime()))
                && (this.getDataType() == null ? other.getDataType() == null : this.getDataType().equals(other.getDataType()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSeriesCode() == null) ? 0 : getSeriesCode().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getParentId() == null) ? 0 : getParentId().hashCode());
        result = prime * result + ((getLevel() == null) ? 0 : getLevel().hashCode());
        result = prime * result + ((getBrandId() == null) ? 0 : getBrandId().hashCode());
        result = prime * result + ((getImageUrl() == null) ? 0 : getImageUrl().hashCode());
        result = prime * result + ((getSizeInch() == null) ? 0 : getSizeInch().hashCode());
        result = prime * result + ((getSizeCm() == null) ? 0 : getSizeCm().hashCode());
        result = prime * result + ((getCreatedById() == null) ? 0 : getCreatedById().hashCode());
        result = prime * result + ((getCreatedByName() == null) ? 0 : getCreatedByName().hashCode());
        result = prime * result + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
        result = prime * result + ((getUpdateById() == null) ? 0 : getUpdateById().hashCode());
        result = prime * result + ((getUpdateByName() == null) ? 0 : getUpdateByName().hashCode());
        result = prime * result + ((getUpdatedTime() == null) ? 0 : getUpdatedTime().hashCode());
        result = prime * result + ((getDataType() == null) ? 0 : getDataType().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", seriesCode=").append(seriesCode);
        sb.append(", name=").append(name);
        sb.append(", parentId=").append(parentId);
        sb.append(", level=").append(level);
        sb.append(", brandId=").append(brandId);
        sb.append(", imageUrl=").append(imageUrl);
        sb.append(", sizeInch=").append(sizeInch);
        sb.append(", sizeCm=").append(sizeCm);
        sb.append(", createdById=").append(createdById);
        sb.append(", createdByName=").append(createdByName);
        sb.append(", createdTime=").append(createdTime);
        sb.append(", updateById=").append(updateById);
        sb.append(", updateByName=").append(updateByName);
        sb.append(", updatedTime=").append(updatedTime);
        sb.append(", dataType=").append(dataType);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

}